home *** CD-ROM | disk | FTP | other *** search
/ Freelog 100 / FreelogNo100-NovembreDecembre2010.iso / ViePratique / Calendar Magic / setup.exe / {app} / NewtonRaphson.shf < prev    next >
Text File  |  2007-02-07  |  471b  |  25 lines

  1. Radians
  2. ' Newton-Raphson Iteration
  3. '
  4. ' Turn on the checkbox "Ignore # lines", then perform iterations by pressing Recalc All.
  5. '
  6. ' Function definition
  7. F(x) = sin(x) - 0.5 * x #
  8. ==> Function F(x) accepted
  9. '
  10. ' Derivative of function
  11. DF(x) = cos(x) - 0.5 #
  12. ==> Function DF(x) accepted
  13. '
  14. ' Initial estimate for root
  15. x = 2 #
  16. ==> x = 2
  17. '
  18. ' Newton-Raphson formula
  19. x = x - F(x) / DF(x)
  20. ==> x = 1.9009955942039
  21. '
  22. ' Check result
  23. F(x)
  24. ==> -4.5200435703061E-3
  25.